<?php
require_once('../includes/modules/database/connect.php');
require_once('../includes/modules/database/function_chungloai.php');
require_once('../includes/modules/database/function_sanpham.php');

$idSanPham=$_GET['idSP'];
$idChungLoai=$_GET['idCL'];
$tenSanPham=$_POST['tenSanPham'];
$moTa=$_POST['moTa'];
$gia=$_POST['gia'];
$urlHinh=$_POST['urlHinh'];
$soLanXem=$_POST['soLanXem'];
$soLuongTonKho=$_POST['soLuongTonKho'];
$ghiChu=$_POST['ghiChu'];
$soLanMua=$_POST['soLanMua'];
$anHien=$_POST['anHien'];
$ngayCapNhat=time();
//var_dump($anHien);exit();
/*var_dump($idSanPham);
var_dump($idChungLoai);
var_dump($tenSanPham);
var_dump($moTa);
//exit();*/
$edit=suaSanPham($idSanPham,$idChungLoai,$tenSanPham,$moTa,$gia,$urlHinh,$soLanXem,$soLuongTonKho,$ghiChu,$soLanMua,$anHien,$ngayCapNhat);
if($edit==true){
	header('location: show_sanpham.php?id='.$idChungLoai);
}
else{
	echo 'error!';
}
?>